##############################################################
## MOD Title: Welcome PM Mod Uninstall instructions version 1.0.0
## MOD Author: ..::Frans::.. < frans@infopolitie.nl > (Frans) http://www.infopolitie.nl
## MOD Description: You only need to follow these instructions if you are currently using version 1.0.0
##                  of DualFusion's WPM mod.
## MOD Version: 1.0.0
##
## Installation Level: Intermediate
## Installation Time: 10 minutes
## Files To Edit: 5
##                includes/acp/acp_board.php
##                includes/acp/info/acp_board.php
##                includes/functions.php
##                language/en/acp/board.php
##                language/en/acp/common.php
## Included Files: n/a
##############################################################
## For Security Purposes, Please Check: http://startrekguide.com/community/viewtopic.php?f=39&t=4655 for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MODs not offered
## in our MOD-Database, located at: http://startrekguide.com/community/viewtopic.php?f=39&t=4655
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ SQL ]------------------------------------------
#
DELETE FROM `phpbb_config` WHERE CONVERT( `config_name` USING utf8 ) = 'wpm_enable' LIMIT 1 ;
DELETE FROM `phpbb_config` WHERE CONVERT( `config_name` USING utf8 ) = 'wpm_send_id' LIMIT 1 ;
DELETE FROM `phpbb_config` WHERE CONVERT( `config_name` USING utf8 ) = 'wpm_subject' LIMIT 1 ;
DELETE FROM `phpbb_config` WHERE CONVERT( `config_name` USING utf8 ) = 'wpm_message' LIMIT 1 ;
DELETE FROM `phpbb_config` WHERE CONVERT( `config_name` USING utf8 ) = 'wpm_preview' LIMIT 1 ;
DELETE FROM `phpbb_config` WHERE CONVERT( `config_name` USING utf8 ) = 'wpm_variables' LIMIT 1 ;
#
#-----[ OPEN ]------------------------------------------
#
includes/acp/acp_board.php
#
#-----[ FIND ]------------------------------------------
#
			/*
 			 * Welcome PM on First Login (WPM)
 			 * By DualFusion
 			 */
			case 'welcome_pm':
				$display_vars = array(
					'title'	=> 'ACP_WELCOME_PM',
					'vars'	=> array(
						'legend1'					=> 'WPM_SETTINGS',
						'wpm_enable'		=> array('lang' => 'WPM_ENABLE',		'validate' => 'bool',		'type' => 'radio:yes_no',	'explain'	=> false),
						'wpm_send_id'		=> array('lang' => 'WPM_SEND_ID',		'validate' => 'string',		'type' => 'text:5:10',		'explain'	=> true),

						'legend2'					=> 'WPM_MESSAGE',
						'wpm_subject'		=> array('lang' => 'WPM_SUBJECT',		'validate' => 'string',		'type' => 'text:40:255',	'explain'	=> true),
						'wpm_message'		=> array('lang' => 'WPM_MESSAGE',		'validate' => 'string',		'type' => 'textarea:9:40',	'explain'	=> true),
						'wpm_variables'		=> array('lang' => 'WPM_VARS',		'validate' => 'string',		'type' => 'custom',			'method'	=> 'variables_wpm',	'explain' => true),

						'legend3'					=> 'WPM_PREVIEW',
						'wpm_preview'		=> array('lang' => 'WPM_PREVIEW',		'validate' => 'string',		'type' => 'custom',			'method'	=> 'preview_wpm',	'explain' => true),
					),
				);
			break;
			/* End WPM */

#
#-----[ REPLACE WITH ]------------------------------------------
# DELETE THE FOUND LINES

#
#-----[ FIND ]------------------------------------------
#
	/*
 	 * Welcome PM on First Login (WPM)
	 * By DualFusion
	 */
	function variables_wpm()
	{
		global $user;
		return $user->lang['WPM_VARIABLES'];
	}

	function preview_wpm()
	{
		/*
		 * The $value and $key are not used in this method
		 * Because the preview is for display purposes only.
		 */
		global $config, $user;
		 
		// Switch array keys, with values in welcome pm.
		$pm_vars = array(
			'{USERNAME}'		=> $user->data['username'],
			'{USER_IP}'			=> $user->ip,
			'{USER_REGDATE}'	=> $user->format_date($user->data['user_regdate']),
			'{USER_EMAIL}'		=> $user->data['user_email'],
			'{SITE_NAME}'		=> $config['sitename'],
			'{SITE_DESC}'		=> $config['site_desc'],
		);
		
		$text 			= $config['wpm_message'];
		$text			= utf8_normalize_nfc($text);
		$uid			= $bitfield			= $options	= '';	// will be modified by generate_text_for_storage
		$allow_bbcode	= $allow_smilies	= true;
		$allow_urls		= false;
		generate_text_for_storage($text, $uid, $bitfield, $options, $allow_bbcode, $allow_urls, $allow_smilies);
		$text			= generate_text_for_display($text, $uid, $bitfield, $options);
		$text			= str_replace(array_keys($pm_vars), array_values($pm_vars), $text);
		
		return $text;
	}
	/* End WPM */
#
#-----[ REPLACE WITH ]------------------------------------------
# DELETE THE FOUND LINES

#
#-----[ OPEN ]------------------------------------------
#
includes/acp/info/acp_board.php
#
#-----[ FIND ]------------------------------------------
#
				'welcome_pm'	=> array('title' => 'ACP_WELCOME_PM', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
#
#-----[ REPLACE WITH ]------------------------------------------
# DELETE THE FOUND LINES

#
#-----[ OPEN ]------------------------------------------
#
includes/functions.php
#
#-----[ FIND ]------------------------------------------
#
			/*
			 * Welcome PM on First Login (WPM)
			 * By DualFusion
			 */
			if($config['wpm_enable'] && $user->data['user_lastvisit'] == 0)
			{
				include($phpbb_root_path . 'includes/functions_wpm.' . $phpEx);
				send_wpm($user->data['user_id']);
			}
			/* End WPM */

#
#-----[ REPLACE WITH ]------------------------------------------
# DELETE THE FOUND LINES

#
#-----[ OPEN ]------------------------------------------
#
language/en/acp/board.php
#
#-----[ FIND ]------------------------------------------
#
/*
 * Welcome PM on First Login (WPM)
 * By DualFusion
 */
$lang = array_merge($lang, array(
	'ACP_WELCOME_PM_EXPLAIN'	=> 'Here you are able to define what message newly registered users will recieve.',

	'WPM_SETTINGS'				=> 'Settings',
	'WPM_ENABLE'				=> 'Enable Welcome PM',
	'WPM_SEND_ID'				=> 'PM Sender ID',
	'WPM_SEND_ID_EXPLAIN'		=> 'The user id of the users that will "send" the PM.',

	'WPM_SUBJECT'				=> 'Subject',
	'WPM_SUBJECT_EXPLAIN'		=> 'The subject of the message that will be sent.',
	'WPM_MESSAGE'				=> 'Message',
	'WPM_MESSAGE_EXPLAIN'		=> 'The body of the message that the PM will contain.',
	'WPM_VARS'					=> 'Dyanamic Variables',
	'WPM_VARS_EXPLAIN'			=> 'Variables that will contain real data of registrant.',
	'WPM_VARIABLES'				=> '<strong>{USERNAME}</strong>: Username<br /><strong>{USER_IP}</strong>: Users\' IP<br /><strong>{USER_REGDATE}</strong>: Date of registration.<br /><strong>{USER_EMAIL}</strong>: User\'s email.<br /><strong>{SITE_NAME}</strong>: Your site\'s name.<br /><strong>{SITE_DESC}</strong>: Your site\'s description.',

	'WPM_PREVIEW'				=> 'Preview',
	'WPM_PREVIEW_EXPLAIN'		=> 'Preview of the message that will be sent.',
));
/* End WPM */
#
#-----[ REPLACE WITH ]------------------------------------------
# DELETE THE FOUND LINES

#
#-----[ OPEN ]------------------------------------------
#
language/en/acp/common.php
#
#-----[ FIND ]------------------------------------------
#
/*
 * Welcome PM on First Login (WPM)
 * By DualFusion
 */
$lang = array_merge($lang, array(
	'ACP_WELCOME_PM'		=> 'Welcome PM on First Login',
	'LOG_CONFIG_WELCOME_PM'	=> '<strong>Altered Welcome PM settings</strong>',
));
/* End WPM */
#
#-----[ DIY ]------------------------------------------
#
Manually delete the file includes/functions_wpm.php. You have now de-installed version 1.0.0.

After de-installing version 1.0.0 you can continue installing the latest version.

Do not forget to UPLOAD and OVERWRITE these changed files.
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM